<script type="text/javascript">
<!--
function checkformulaire()
{
	frm = document.forms['formannonce'];	
	error = 0;
	if(frm.elements['titre'].value == "")
	{	
		alert("{$lang.Saisir_titre_annonce}");
		error++;
	}

	if(frm.elements['departement'].options[this.frm.elements['departement'].selectedIndex].value == "" || frm.elements['departement'].options[this.frm.elements['departement'].selectedIndex].value == "0")
	{	
		alert("{$lang.Selectionner_departement}");
		error++;
	}
	if(frm.elements['prix'].value == "")
	{	
		alert("{$lang/Saisir_prix}");
		error++;
	}

	if(error > 0)
	{
		return false;
	}
	else
	{
		return true;
	}
}
-->
</script>
<h3>{$lang.Edition_annonce}</h3>
<br />
<br />
<form method="post" onsubmit="return checkformulaire()" name="formannonce" id="formannonce" action="annonce.php">
<table style="margin:auto;">
	<tr>
		<td class="tcontenue"><label>{$lang.Titre} :</label></td>
		<td class="tcontenue"><input type="text" name="titre" value="{$annonce.titre}" id="titre"/></td>
	</tr>
	<tr>
		<td class="tcontenue"><label>{$lang.Titre_court} :</label></td>
		<td class="tcontenue"><input type="text" name="titre_court" value="{$annonce.titre_court}" id="titre_court"/></td>
	</tr>
	<tr>
		<td class="tcontenue"><label>{$lang.Reference} :</label></td>
		<td class="tcontenue"><input type="text" name="reference" value="{$annonce.ref}" id="reference" /></td>
	</tr>
	<tr>
		<td class="tcontenue"><label>{$lang.Type} :</label></td>
		<td class="tcontenue">{html_options name=type options=$type_array selected=$type_selected}</td>
	</tr>
	<tr>
        <td class="tcontenue"><label>{$lang.Description} :</label>
	   <td colspan="2">{$description_champ}</td>
    </tr>
    <tr>
		<td class="tcontenue"><label>{$lang.Ville} :</label></td>
		<td class="tcontenue"><input type="text" name="ville" id="ville" value="{$annonce.ville}" /></td>
	</tr>
	<tr>
		<td class="tcontenue"><label>{$lang.Secteur} :</label></td>
		<td class="tcontenue">{html_options name=secteur options=$secteur_array selected=$secteur_selected}&nbsp;&nbsp;
            <input type="text" name="secteur_text" />           
        </td>
	</tr>
	<tr>
		<td class="tcontenue"><label>{$lang.Departement} :</label></td>
		<td class="tcontenue">{html_options name=departement options=$departement_array selected=$departement_selected}</td>
	</tr>
	<tr>
		<td class="tcontenue"><label>{$lang.Coup_de_coeur} :</label></td>
		<td class="tcontenue">
            <select name="coupdecoeur">
                <option value="0" {if $annonce.cdc == 0} selected="selected" {/if} >{$lang.Non}</option>
                <option value="1" {if $annonce.cdc == 1} selected="selected" {/if} >{$lang.Oui}</option>
            </select>
        </td>
	</tr>
	<tr>
		<td class="tcontenue"><label>{$lang.Vendu} :</label></td>
		<td class="tcontenue">
            <select name="vendu">
                <option value="0" {if $annonce.vendu == 0} selected="selected" {/if} >{$lang.Non}</option>
                <option value="1" {if $annonce.vendu == 1} selected="selected" {/if} >{$lang.Vendu_par_agence}</option>
                <option value="2" {if $annonce.vendu == 2} selected="selected" {/if} >{$lang.Vendu_par_concurence}</option>
            </select> 
        </td>
	</tr>
	<tr>
		<td class="tcontenue"><label>{$lang.Active} :</label></td>
		<td class="tcontenue">
            <select name="active">
                <option value="0" {if $annonce.active == 0} selected="selected" {/if} >{$lang.Non}</option>
                <option value="1" {if $annonce.active == 1} selected="selected" {/if} >{$lang.Oui}</option>
            </select>
        </td>
	</tr>
	<tr>
		<td class="tcontenue"><label>{$lang.Prix_fai} :</label></td>
		<td class="tcontenue"><input type="text" name="prix" id="prix" value="{$annonce.prix}"/> &euro;</td>
	</tr>
	<tr>
		<td class="tcontenue"><label>{$lang.Agence} :</label></td>
		<td class="tcontenue">{html_options name=agence options=$agence_array selected=$agence_selected}</td>
	</tr>
	<tr>
		<td colspan="2">&nbsp;
            <input type="hidden" name="token" value="{$token}" />
			<input type="hidden" name="annonce_id" value="{$annonce.id}" />
			<input type="hidden" name="old_vendu" value="{$annonce.vendu}" />
			<input type="hidden" name="old_active" value="{$annonce.active}" />
		</td>
	</tr>
	<tr><td colspan="2" align="center"><input type="submit" name="edition" value="{$lang.Modifier}" /></td></tr>
</table>
<br />
<br />